<div class="featuredRow">
  Nombre:<br/> <%= text_field :desc, :name %>
</div>
<br/>
<div class="featuredRow">
  Tipo:<br/> <%= select(:desc, :kind, [[ "Texto plano", 2 ], ["Archivo", 1]] ) %>
</div>
<br/>
<div class="featuredRow">
  <% if @assignment %>
    Ponderacion del final: <br/><%= text_field :desc, :weight %>
  <% end %>
</div>
<br/>
<script language="javascript">
  function cambiar(){
    if( $("desc_kind").selectedIndex == 0 ){
      Effect.Fade('fileField');
      $("tfF").disabled = true;
      Effect.Appear('textArea');
      $("taF").disabled = false;
    }
    else if( $("desc_kind").selectedIndex == 1 ){
      Effect.Fade('textArea');
      $("taF").disabled = true;
      Effect.Appear('fileField');
      $("tfF").disabled = false;
    }
  }
  $('desc_kind').onchange = cambiar;
</script>
<div class="featuredRow" id="textArea">Descripcion: <br/><%= text_area :desc_data, :data, :id => 'taF' %></div><br/>
<div class="featuredRow" id="fileField" style="display: none">Archivo: <br/><%= file_field :desc_data, :data, :id => 'tfF' %></div>
<script language="javascript">
  cambiar();
</script>

<div class="featuredRow">Fecha de inicio: <br/><%= datetime_select(:desc, :due_date, { :discard_second => true, :use_month_numbers => true, :start_year => Time.now.year, :end_year => 10.years.from_now.year } ) %></div><br/>
<div class="featuredRow">Fecha de expiracion: <br/><%= datetime_select(:desc, :expire_date, { :discard_second => true, :use_month_numbers => true, :start_year => Time.now.year, :end_year => 10.years.from_now.year }) %></div><br />
<div class="featuredRow"><%= submit_tag "Agregar" %></div>
